<?php
/*********************************************
  CPG DragonflyCMS, Copyright (c) 2011 by DragonflyCMS Dev Team
  http://dragonflycms.org
  Released under GNU GPL version 2 or any later version

  $Revision$
  $Date$
  $Source$
**********************************************/
if (!defined('CPG_NUKE')) { exit; }

$where = (isset($_GET['cat']) && is_numeric($_GET['cat'])) ? 'WHERE catid='.intval($_GET['cat']) : '';
$result = $db->query('SELECT sid as id, title, time, hometext as description FROM '.$prefix.'_stories '.$where.' ORDER BY sid DESC LIMIT 10');
while ($row = $db->sql_fetchrow($result)) {
	if (!SynFeed::$pubDate) SynFeed::$pubDate = $row['time'];
	$row['link'] = URL::index(SynFeed::$category .'&amp;file=article&amp;sid='.$row['id'], true, true);
	SynFeed::$items[] = $row;
	$row = null;
}

SynFeed::template();
$cpgtpl->set_handle('body', 'feed_rss.xml');
$cpgtpl->display('body');

